package com.railwayservice.user.service;

import com.railwayservice.user.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

/**
 * 用户服务类
 *
 * @author lid
 * @date 2017.2.4
 */
public interface UserService {
    /**
     * 查找所有的用户
     *
     * @return list
     * @author lid
     * @date 2017.2.4
     */
    List<User> getAllUser();

    /**
     * 根据id查找用户信息
     *
     * @param id
     * @return User
     * @author lid
     * @date 2017.2.9
     */
    User getUserByUserId(String id);

    /**
     * 根据openid查找用户信息
     *
     * @param String openid
     * @return User
     * @author lid
     * @date 2017.2.9
     */
    User getUserByOpenid(String openid);

    /**
     * 添加用户
     *
     * @param user
     * @return User
     * @author lid
     * @date 2017.2.4
     */
    User addUser(User user);

    /**
     * 修改用户
     *
     * @param user
     * @return user
     * @author lid
     * @date 2017.2.4
     */
    User updateUser(User user);

    /**
     * 查找所有的用户
     *
     * @author lidx
     * @date 2017.2.4
     */
    Page<User> queryAllUser(String nickName, String phoneNo, Pageable pageable);
    
    /**
     * 查找所有的用户
     *
     * @author albert
     * @date 2017.5.3
     */
    Page<User> queryAllUsers(String nickName, String phoneNo,String openid, Pageable pageable);

    /**
     * 查询用户推广情况 
     * @param param
     * @param pageable
     * @return
     */
    Page<User> queryPromotion(String param, Pageable pageable);
    
    /**
     * 查询用户推广情况 
     * @param param
     * @return
     */
	List<User> queryPromotion(String param);
	
	/**
	 * 获取用户邀请信息
	 * @param userId
	 * @return
	 * @author lid
	 */
	Map<String,Object> getInviteInfo(String userId);
}
